<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>freemarker</title>
</head>
<style type="text/css">
    body {
        font-family: Verdana, Microsoft YaHei, Simsun;
        line-height: 30px;
        align-content: left;
        text-align: left;
    }
</style>
<body>
<h3>freemarker实现遍历list集合</h3>
<ul>
    <li>集合list</li>
    <#list programList as item>
        <lu><font color="blue">${item}</font></lu>
    </#list>
</ul>
<hr size="10" color="blue">
<h1>if表达式</h1>
<ul>
    <li>if :
        <#assign var = 99/>
        <#if var == 99>
            <font color="red">var=99</font>
        </#if>
        <br/>
        <#if var == 99>
            <font color="red">var=99</font>
            <#else/>
            <font coloe="green">var!=99</font>
        </#if>
        <br/>
        <#if var &gt; 99>   <!-- &gt;  大于 -->
            <font color="red">var大于99</font>
            <#elseif var==99/>
            <font coloe="green">var=99</font>
            <#else/>
            <font coloe="blue">var小于99</font>
        </#if>
    </li>

    <li>if多条件 ||，&&，! :
        <#assign var='python'/>
        <#if var =='python' || var =='Java'>
            <font color="red">python or java</font><br/>
        </#if>
        <#if var =='python' && var?length == 6>
            <font color="yellow">python length 6</font><br/>
        </#if>
        <#if (var =='python' && var?length == 6) || (var == 'java')>
            <font color="black">python length 6或者Java</font><br/><br/>
        </#if>
        <#if !((var =='python' && var?length == 6) || (var == 'java'))>
            <font color="black">python length 6或者Java</font><br/><br/>
        </#if>
    </li>
</ul>
</body>
</html>